package com.hankol.newretail.viewmodel

import androidx.lifecycle.MutableLiveData
import com.baselibrary.base.BasicListBean
import com.baselibrary.base.mvvm.BaseViewModel
import com.hankol.newretail.bean.SeckillCategoryActList
import com.hankol.newretail.bean.SeckillCategoryBean
import com.hankol.newretail.bean.SeckillConfigBean
import com.hankol.newretail.respository.NewReatilRequestManager

/**
 * @author: 关忆北、
 * @date: 2022/8/5
 * @Des：
 */
class SeckillViewModel : BaseViewModel() {

    var seckillConfigLD: MutableLiveData<SeckillConfigBean> = MutableLiveData()

    var seckillCategoryLD: MutableLiveData<ArrayList<SeckillCategoryBean>> = MutableLiveData()

    var seckillCategoryActListLD: MutableLiveData<BasicListBean<SeckillCategoryActList>> = MutableLiveData()

    /**
     *秒杀配置
     */
    fun reqSeckillConfig() {
        NewReatilRequestManager.getInstance().reqSeckillConfig(seckillConfigLD)
    }

    /**
     *秒杀分类
     */
    fun reqSeckillCategory() {
        NewReatilRequestManager.getInstance().reqSeckillCategory(seckillCategoryLD)
    }

    /**
     *秒杀分类商品列表
     */
    fun reqSeckillCategoryActList(cid: Int, page: Int) {
        NewReatilRequestManager.getInstance().reqSeckillCategoryActList(seckillCategoryActListLD, cid, page)
    }

    /**
     *酒窖秒杀商品列表
     */
    fun reqSeckillWineryActList(shopId: Int, page: Int) {
        NewReatilRequestManager.getInstance().reqSeckillWineryActList(seckillCategoryActListLD, shopId, page)
    }
}